namespace go user

/* 用户注册 */
struct UserRegisterRequest {
    1: required string username,  // 注册用户名，最长32个字符
    2: required string password,  // 密码，最长32个字符
}

struct UserRegisterResponse {
    1: required i32 status_code,
    2: optional string status_msg,
    3: required i64 user_id,
    4: required string token,
}
/* 用户登录 */
struct UserLoginRequest {
    1: required string username,
    2: required string password,
}

struct UserLoginResponse {
    1: required i32 status_code,
    2: optional string status_msg,
    3: required i64 user_id,
    4: required string token,
}
/* 用户信息 */
struct User {
    1: required i64 id,  // 用户ID
    2: required string name,  // 用户名称
    3: required i64 follow_count,  // 关注总数
    4: required i64 follower_count,  // 粉丝总数
    5: required bool is_follow,  // true-已关注，false-未关注
}

struct UserInfoRequest {
    1: required i64 user_id,
    2: required string token,
}

struct UserInfoResponse {
    1: required i32 status_code,
    2: optional string status_msg,
    3: required User user,
}

service UserService {
    UserRegisterResponse Register(1:required UserRegisterRequest request),
    UserLoginResponse Login(1:required UserLoginRequest request),
    UserInfoResponse UserInfo(1:required UserInfoRequest request),
}